<?php echo $this->Session->flash(); ?>
<div id="loading" style="display: none;">
    <?php echo $html->image('loading.gif', array('border' => "0", 'align' => 'center')); ?>
</div>
<h1>ENCUESTAS</h1>
<table id="tabla">
    <thead>
        <tr>
            <th>Id</th>
            <th>Caracteristicas biofísicas</th>
            <th>Social</th>
            <th>Económico</th>
            <th>Ambiental</th>
            <th>Visto bueno</th>
            <th>Verificación fase I</th>
            <th>Observaciones</th>
            <th colspan="2">Acciones</th>
        </tr>
    </thead>
    <tbody>
        <?php $habilitar_boton = true ?>
        <?php foreach ($polls as $poll): ?>
            <tr>
                <td><?php echo $poll['Poll']['id'] ?></td>
                <td><?php echo $poll['Poll']['calificacion_caracteristicas_biofisicas'] ?></td>
                <td><?php echo $poll['Poll']['calificacion_sociales'] ?></td>
                <td><?php echo $poll['Poll']['calificacion_economicos'] ?></td>
                <td><?php echo $poll['Poll']['calificacion_ambientales'] ?></td>
                <td><?php echo $poll['Poll']['visto_bueno'] ?></td>
                <td><?php echo $poll['Poll']['verificacion_fase_uno'] ?></td>
                <td><?php echo substr($poll['Poll']['observaciones'], 0, 200) . "..." ?></td>
                <td><?php if ($habilitar_boton) echo $ajax->link('Editar', array('Controller' => 'Polls', 'action' => 'edit', $poll['Poll']['id']), array('class' => 'actions', 'update' => 'content', 'complete' => 'cargar()', 'indicator' => 'loading', 'escape' => false)); ?></td>
                <td><?php echo $this->Html->link('Imprimir', array('controller' => 'Polls', 'action' => 'print_poll', $poll['Poll']['id']), array('class' => 'actions', 'target' => 'blank')); ?></td>
            </tr>
            <?php $habilitar_boton = false ?>
        <?php endforeach; ?>
    </tbody>
</table>
<br><?php echo $ajax->link('Adicionar ', array('Controller' => 'Polls', 'action' => 'add', $proyect_id), array('class' => 'actions', 'update' => 'content', 'complete' => 'cargar()', 'indicator' => 'loading', 'escape' => false), "¿Desea agregar una nueva encuesta?, Una vez agregada aparecerá en la lista, desde allí podrá comenzar a llenarla."); ?>
<br><br><br>